<?php

class BaseController extends CController {

    public $layout='//layouts/layout_main';

    public $menu=array();

    public $breadcrumbs=array();

    public function init() {

        $userId = Yii::app()->session['userId'];
        Yii::app()->session['userId'] = $userId;
        $userEmail = Yii::app()->session['userEmail'];
        Yii::app()->session['userEmail'] = $userEmail;
    }

    public function session() {

        if(Yii::app()->session['userEmail'] && Yii::app()->session['userId']) {
            return true;
        }
        return false;
    }

    public function sessionSaveUserId($userId) {

        Yii::app()->session['userId'] = $userId;
    }

    public function sessionSaveUserEmail($userEmail) {

        Yii::app()->session['userEmail'] = $userEmail;
    }

}